import React, { Component } from 'react';
import * as rest from '../../lib/rest'
import ColumnSearchTable from "../../components/table/ColumnSearchTable";
import { data2Column } from '../../components/table/Data2Column';


export default class RecList extends Component{
    constructor(props){
        super(props);
        this.state = {
            data:[]
        }
    }

    componentDidMount() {
        rest.get(`/recBase/all`).then((recList)=>{
            this.setState({
                data: recList
            })
        })
    }



    render() {
        const columns = ["recId","recName","recTextDesc","recSupDesc","recFileId","status","version"]
        const resultcolumn = data2Column(columns);
        return <ColumnSearchTable columns={resultcolumn} dataSource={this.state.data} />;
    }
}
